@import "../../style/variables.less";
@import "../../style/mixins/index.less";

.w-radio-inner{
  input[type="radio"] {
    position: relative;
    width: 16px;
    height: 16px;
    background-clip: border-box;
    appearance: none;
    margin: -.15px .6px 0 0;
    vertical-align: text-bottom;
    border-radius: 50%;
    background-color: #fff;
    border: 1px solid #d7d7d7;
    transition: border .25s,box-shadow .25s;
    &:before {
      content: ' ';
      display: block;
      height: 8px;
      width: 8px;
      transform: scale(0.6) rotate(0deg);
      border-radius: 50%;
      margin: 3px 0 0 3px;
      opacity: 0;
      transition: opacity .25s,transform .25s;
      background-color: #0fa120;
    }
    &:checked {
      border: 1px solid #0fa120;
      &:before {
        opacity: 1;
        transform: scale(1) rotate(0deg);
      }
    }
    &:focus{
      outline: none;
      box-shadow: 0 0 0 2px rgba(84, 220, 103, 0.14);
    }
  }
}

.w-radio-text{
  margin-left: 4px;
  margin-right: 5px;
}

.w-radio{
  white-space: nowrap;
  font-size: 12px;
  cursor: pointer;
  & + .w-radio{
    margin-left: 5px;
  }
  &.disabled{
    z-index: 2;
    color: #c7c7c7;
    cursor: @cursor-disabled;
    input{
      cursor: @cursor-disabled;
      background-color: #ececec;
      border: 1px solid #d7d7d7;
      &[type="radio"]:checked{
        border: 1px solid #d7d7d7;
      }
      &:before{
        background-color: #d7d7d7;
      }
    }
  }
}

.w-radio-group{
  display: inline-block;
  font-size: 12px;
}

.w-radio-button:first-child {
  border-radius: 4px 0 0 4px;
  border-left: 1px solid #d9d9d9;
}
.w-radio-button:last-child {
  border-radius: 0 4px 4px 0;
}

.w-radio-button{
  position: relative;
  margin: 0;
  height: 30px;
  line-height: 28px;
  color: rgba(0,0,0,.65);
  display: inline-block;
  transition: all .3s ease;
  vertical-align: middle;
  cursor: pointer;
  border: 1px solid #d9d9d9;
  border-left: 0;
  background: #fff;
  padding: 0 10px;
  & + .w-radio-button{
    margin-left: 0;
    &:last-child{
      margin-left: -1px;
    }
  }
  .w-radio-inner{
    display: none;
  }
  &.checked{
    background-color: #0fa120;
    border-color: #0fa120;
    color: #fff;
    z-index: 2;
  }
  &.disabled{
    background-color: #f2f2f2;
  }
}